<template>
	<view>
		<!-- 文本 -->
		<scroll-view v-if="showData.type === '2'" scroll-x class="bg-white nav" scroll-with-animation
			:style="{color:showData.fontColor,backgroundColor: showData.bgColor}" >
			<view class="cu-item" v-for="(item,index) in showData.navList" @tap="toPage(item.linkUrl)" :key="index"
				:data-id="index">
				{{item.title}}
			</view>
		</scroll-view>
		<!-- 图文 -->
		<view v-if="showData.type === '1'" class="cu-list grid no-border" :class="'col-'+showData.showNum"
			:style="{backgroundColor: showData.bgColor}">
			<view class="cu-item" v-for="(item, index) in showData.navList" :key="index">
				<view @tap="toPage(item.linkUrl)">
					<image :src="item.url" mode="aspectFill" style="height: 25px;width: 25px;"></image>
					<text :style="{color:`${showData.fontColor}`}">{{ item.title }}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>

	import {
		toJumpUrl,
	} from '@/utils/index.js';
	export default {
		props: {
			showData: {
				type: Object,
				default: () => {}
			},
		},
		data() {
			return {
				tabCur: 0
			}
		},
		methods: {
			toPage(jumpUrl) {
				toJumpUrl(jumpUrl);
			},
			tabSelect(e) {
				this.tabCur = e.currentTarget.dataset.id;
			}
		}
	}
</script>

<style>
</style>
